package com.weitu.permission.district.entity;

import java.io.Serializable;

/** 
 * 区县表 SYS_COUNTY
 * @author LiMeng
 * date 2017/04/07 14:44
 */
public class County implements Serializable {
    //串行版本ID
    private static final long serialVersionUID = -1732279630945547661L;

    private String code;

    private String name;

    private String parentCode;

    /** 
     * 获取 SYS_COUNTY.code
     * @return SYS_COUNTY.code
     */
    public String getCode() {
        return code;
    }

    /** 
     * 设置 SYS_COUNTY.code
     * @param code SYS_COUNTY.code
     */
    public void setCode(String code) {
        this.code = code == null ? null : code.trim();
    }

    /** 
     * 获取 SYS_COUNTY.name
     * @return SYS_COUNTY.name
     */
    public String getName() {
        return name;
    }

    /** 
     * 设置 SYS_COUNTY.name
     * @param name SYS_COUNTY.name
     */
    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    /** 
     * 获取 SYS_COUNTY.parentCode
     * @return SYS_COUNTY.parentCode
     */
    public String getParentCode() {
        return parentCode;
    }

    /** 
     * 设置 SYS_COUNTY.parentCode
     * @param parentCode SYS_COUNTY.parentCode
     */
    public void setParentCode(String parentCode) {
        this.parentCode = parentCode == null ? null : parentCode.trim();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        County county = (County) o;

        if (code != null ? !code.equals(county.code) : county.code != null) return false;
        if (name != null ? !name.equals(county.name) : county.name != null) return false;
        return parentCode != null ? parentCode.equals(county.parentCode) : county.parentCode == null;
    }

    @Override
    public int hashCode() {
        int result = code != null ? code.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (parentCode != null ? parentCode.hashCode() : 0);
        return result;
    }

    @Override

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append(", code=").append(code);
        sb.append(", name=").append(name);
        sb.append(", parentCode=").append(parentCode);
        sb.append("]");
        return sb.toString();
    }
}